﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

namespace Centny
{
    public class ExtBaseGrid : Grid
    {
        public delegate void LoadedCompleted(ExtBaseGrid ebg);
        private List<LoadedCompleted> _OnLoadedCompleted = new List<LoadedCompleted>();
        public event LoadedCompleted OnLoadedCompleted
        {
            add
            {
                this._OnLoadedCompleted.Add(value);
            }
            remove
            {
                this._OnLoadedCompleted.Remove(value);
            }
        }
        public ExtBaseGrid()
        {
            this.Loaded += LoadedCall;
        }
        private void LoadedCall(object sender, RoutedEventArgs e)
        {
            this.OnLoaded(sender, e);
            foreach (LoadedCompleted lc in this._OnLoadedCompleted)
            {
                lc(this);
            }
        }
        protected virtual void OnLoaded(object sender, RoutedEventArgs e)
        {

        }
    }
}
